using NExt.Serialization;

namespace NExt.Core.Validator
{
    public class Composite : ValidatorScript
    {
        private const string FUNCTION_NAME = "Composite";

        private Composite(params string[] parameterNames)
            : base(FUNCTION_NAME, parameterNames)
        {
        }

        public static Composite Create(params ValidatorScript[] validatorScripts)
        {
            string serializedValidators = JsonSerializer.Serialize(validatorScripts);
            Composite composite = new Composite(serializedValidators);
            return composite;
        }

    }
}